<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core"
  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:vetlabtags="urn:jsptagdir:/WEB-INF/tags/vetlab">
  <jsp:directive.page contentType="text/html; charset=UTF-8" session="false" isELIgnored="false" />
  <vetlabtags:page title="Registrazione">
    <vetlabtags:bar />
    <vetlabtags:uleftColumn />
    <div id="urightColumn">
      <p class="Stile2">REGISTRAZIONE</p>
      <c:choose>
        <c:when test="${empty newUser}">
          <p class="Stile1">
            Inserire i dati di registrazione.
            I campi contrassegnati con
            <span class="required">*</span>
            sono obbligatori.
          </p>
          <br />
          <form id="registrationForm" method="post" action="${ctx}${uri}">
            <!-- FIRST NAME -->
            <c:set var="error" value="${errors.firstName}" />
            <div class="row${empty error ? '' : 'error'}">
              <label for="firstName">
                Nome:
                <span class="required">*</span>
              </label>
              <input id="firstName" type="text" name="firstName" value="${param.firstName}" class="" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- LAST NAME -->
            <c:set var="error" value="${errors.lastName}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="lastName">
                Cognome:
                <span class="required">*</span>
              </label>
              <input id="lastName" type="text" name="lastName" value="${param.lastName}" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- EMAIL -->
            <c:set var="error" value="${errors.email}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="email">
                Email:
                <span class="required">*</span>
              </label>
              <input id="email" type="text" name="email" value="${param.email}" class="long" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- ADDRESS -->
            <c:set var="error" value="${errors.address}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="address">Indirizzo:</label>
              <input id="address" type="text" name="address" value="${param.address}" class="long" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- PHONE -->
            <c:set var="error" value="${errors.phone}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="phone">Telefono:</label>
              <input id="phone" type="text" name="phone" value="${param.phone}" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- CITY -->
            <c:set var="error" value="${errors.city}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="city">
                Ordine:
                <span class="required">*</span>
              </label>
              <input id="city" type="text" name="city" value="${param.city}" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- NUMBER -->
            <c:set var="error" value="${errors.number}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="number">
                Nr. iscrizione:
                <span class="required">*</span>
              </label>
              <input id="number" type="text" name="number" value="${param.number}" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- PASSWORD -->
            <c:set var="error" value="${errors.password}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="password">
                Scegli una password:
                <span class="required">*</span>
              </label>
              <input id="password" type="password" name="password" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <!-- CONFIRM PASSWORD -->
            <c:set var="error" value="${errors.confirmPassword}" />
            <div class="row ${empty error ? '' : 'rowerror'}">
              <label for="confirmPassword">
                Conferma password:
                <span class="required">*</span>
              </label>
              <input id="confirmPassword" type="password" name="confirmPassword" />
              <c:if test="${not empty error}">
                <div class="message">${error}</div>
              </c:if>
            </div>
            <div>
              <input type="submit" name="register" value="Registrati" class="submit register" />
            </div>
          </form>
        </c:when>
        <c:otherwise>
          <p>
            <![CDATA[Registrazione effettuata con successo.]]>
            <br />
            <c:set var="error" value="${errors.sendMail}" />
            <c:choose>
              <c:when test="${empty error}">
                <![CDATA[La richiesta &egrave; stata inoltrata ad un amministratore:]]>
                <![CDATA[ attendere l'email di notifica di abilitazione all'accesso.]]>
              </c:when>
              <c:otherwise>${error}</c:otherwise>
            </c:choose>
          </p>
        </c:otherwise>
      </c:choose>
    </div>
    <vetlabtags:lleftColumn />
  </vetlabtags:page>
</jsp:root>
